package com.gitee.huxing.course.config.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Description:
 * @ProjectName: JavaCourse
 * @Package: com.gitee.huxing.course.config.exception
 * @ClassName: GlobalException
 * @Author: huxing
 * @DateTime: 2021-10-26 下午3:48
 */
@RestControllerAdvice
public class GlobalException {

    @ExceptionHandler(value = ServiceException.class)
    public String exceptionHandler(Exception ex){
        return ex.getMessage();
    }
}
